Lab 10

  1. Write a complete C++ program that asks the user to type a big integer n. It should then ask 4 times for the user to type a smaller value of n and then terminate the program. However, if the user enters a value that is not smaller it should immediately say "Goodbye" and terminate the program.
  2. A sample run of the program:
    Type a big integer n: 100 Type a smaller value of n: 20 Type a smaller value of n: 10 Type a smaller value of n: 2 Type a smaller value of n: 1

    Another sample run of the program:
    Type a big integer n: 100 Type a smaller value of n: 0 Type a smaller value of n: 0 Goodbye

  3. Write a complete C++ program that does the following:
  4. A sample run of the program:
    Enter value for n: 5 XOOOO X X X OOOOX
  5. Write a complete C++ program that does the following:
  6. A sample run of the program:
    Enter value for n: 7 + + + * x x x

  7. Write a complete C++ program that does the following:
  8. A sample run of the program:
    Enter value for n: 7 + x + x + x * + x + x + x

  9. Write a complete C++ program that does the following:
  10. A sample run of the program:
    Enter an integer between 1 and 20: 100 Out of range. Enter an integer between 1 and 20: -1 Out of range. Enter an integer between 1 and 20: 5 The cube of your number is 125.